package com.lenovo.leos.filebrowser.netdisk;

public final class Log {
	private static final String TAG_PREFIX = "GB_FB_";

	private static boolean isDebug = true;
	
	public static void enableLog(boolean isEnable){
		if (isEnable != isDebug){
			if (isEnable){
				Log.i(TAG_PREFIX + "Log", "enable log");
			}else
				Log.i(TAG_PREFIX + "Log", "disable log");
			
			isDebug = isEnable;
		}
	}

	public static int v(String tag, String msg) {
		return isDebug ? android.util.Log.v(TAG_PREFIX + tag, msg) : -1;
	}

	public static int v(String tag, String msg, Throwable tr) {
		return isDebug ? android.util.Log.v(TAG_PREFIX + tag, msg, tr) : -1;
	}

	public static int d(String tag, String msg) {
		return isDebug ? android.util.Log.d(TAG_PREFIX + tag, msg) : -1;
	}

	public static int d(String tag, String msg, Throwable tr) {
		return isDebug ? android.util.Log.d(TAG_PREFIX + tag, msg, tr) : -1;
	}

	public static int i(String tag, String msg) {
		return isDebug ? android.util.Log.i(TAG_PREFIX + tag, msg) : -1;
	}

	public static int i(String tag, String msg, Throwable tr) {
		return isDebug ? android.util.Log.i(TAG_PREFIX + tag, msg, tr) : -1;
	}

	public static int w(String tag, String msg) {
		return isDebug ? android.util.Log.w(TAG_PREFIX + tag, msg) : -1;
	}

	public static int w(String tag, String msg, Throwable tr) {
		return isDebug ? android.util.Log.w(TAG_PREFIX + tag, msg, tr) : -1;
	}

	public static int w(String tag, Throwable tr) {
		return isDebug ? android.util.Log.w(TAG_PREFIX + tag, tr) : -1;
	}

	public static int e(String tag, String msg) {
		return isDebug ? android.util.Log.e(TAG_PREFIX + tag, msg) : -1;
	}

	public static int e(String tag, String msg, Throwable tr) {
		return isDebug ? android.util.Log.e(TAG_PREFIX + tag, msg, tr) : -1;
	}
}
